package fzdy.event;

import com.google.common.eventbus.Subscribe;
import fzdy.entity.DeviceInfo;
import fzdy.service.IDeviceAlarmService;
import fzdy.service.IDeviceInfoService;
import fzdy.service.IDeviceMalfunctionService;
import fzdy.service.impl.DeviceInfoService;
import fzdy.struct.DevicePostData;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.DependsOn;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Component("httpmsghandle")
@Scope("prototype")
public class HttpMsgHandle {

    @Autowired
    private EventCenter eventCenter;

    @PostConstruct
    public void init(){
        eventCenter.registerObserver(this);
    }

    @Subscribe
    public void dealHttpMsg(DevicePostData devicePostData){

        System.out.println(devicePostData.toString());
    }
}
